using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using SEO.Model;
using SEO.DAL;

namespace SEO.BLL
{

    /// <summary>
    /// 版权所有: 版权所有(C) 2011，上海云里网络科技有限公司
    /// 内容摘要: EDMMailContentBLL
    /// 完成日期：2011年7月29日
    /// 版    本：V1.0 
    /// 作    者：Adin
    /// </summary>
    public class EDMMailContentBLL
    {
        EDMMailContentDAL etDAL = new EDMMailContentDAL();

        /// <summary>
        /// 获取EDMMailContent表中所有数据
        /// <returns>返回List类型</returns>
        /// </summary>
        public List<EDMMailContent> GetAllEDMMailContentBLL()
        {
            return etDAL.GetAllEDMMailContentDAL();
        }

        /// <summary>
        /// 根据传入的SQL语句获取EDMMailContent表中数据
        /// </summary>
        /// <param name="strSql">SQL语句</param>
        /// <returns>返回List类型</returns>
        public List<EDMMailContent> GetEDMMailContentByWhereBLL(string strSql)
        {
            return etDAL.GetEDMMailContentByWhereDAL(strSql);
        }

        /// <summary>
        /// 往EDMMailContent表中插入数据
        /// </summary>
        /// <returns>返回插入条数</returns>
        public int InsertEDMMailContentBLL(SEO.Model.EDMMailContent et)
        {
            return etDAL.InsertEDMMailContentDAL(et);
        }

        /// <summary>
        /// 根据ID更新EDMMailContent表中数据
        /// </summary>
        /// <param name="et">实例化EDMMailContent类</param>
        /// <returns>返回更新条数</returns>
        public int UpdateEDMMailContentNewBLL(SEO.Model.EDMMailContent et)
        {
            return etDAL.UpdateEDMMailContentNewDAL(et);
        }

        /// <summary>
        /// 根据ID更新EDMMailContent表中数据
        /// </summary>
        /// <param name="et">实例化EDMMailContent类</param>
        /// <returns>返回更新条数</returns>
        public int UpdateEDMMailContentBLL(SEO.Model.EDMMailContent et)
        {
            return etDAL.UpdateEDMMailContentDAL(et);
        }

        /// <summary>
        /// 根据指定条件删除EDMMailContent表中数据
        /// <param name="strSql">SQL语句</param>
        /// <returns>返回删除条数</returns>
        public int DeleteEDMMailContentBLL(string strSql)
        {
            return etDAL.DeleteEDMMailContentDAL(strSql);
        }

        /// <summary>
        /// 绑定表EDMMailContent到DataGridView
        /// <param name="dgv">DataGridView控件名称</param>
        /// <param name="strSql">SQL语句</param>
        /// </summary>
        public void BindEDMMailContentBLL(System.Windows.Forms.DataGridView dgv, string strSql)
        {
            etDAL.BindEDMMailContentDAL(dgv, strSql);
        }

        /// <summary>
        /// 更新所有邮件内容为未发布状态
        /// </summary>
        /// <returns></returns>
        public int UpdateAllEDMMailContentPostStatusBLL()
        {
            return etDAL.UpdateAllEDMMailContentPostStatusDAL();
        }

    }
}
